package com.sloera.spring.struts2.listeners;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @author sloera
 * @create 2020/4/23
 */
public class SpringServletContextListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        // 1. 创建IOC容器
        ApplicationContext ctx = new ClassPathXmlApplicationContext("struts-application.xml");
        // 2. 将IOC容器放入ServletContext的一个属性中
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
